package com.sfpay.coreplatform.account.valueobject.dto;

import com.sfpay.coreplatform.account.common.enums.ExpenseFlag;

/**
 * 
 * 
 * 类说明：对账数据VO类
 * 
 * 
 * <p>
 * 详细描述：
 * 
 * 
 * @author 313172 Kucha
 * 
 *         CreateDate: 2012-3-2
 */
public class RecDataVO {

	/**
	 * 支付订单编号
	 */
	private String paymentOrderNO;

	/**
	 * 金额
	 */
	private long amount;

	/**
	 * 金额类型
	 */
	private String type;

	public long getAmount() {
		return amount;
	}

	public void setAmount(long amount) {
		this.amount = amount;
	}

	public String getPaymentOrderNO() {
		return paymentOrderNO;
	}

	public void setPaymentOrderNO(String paymentOrderNO) {
		this.paymentOrderNO = paymentOrderNO;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	/**
	 * 获取金额类型值
	 * 
	 * 方法说明：
	 * 
	 * @return
	 */
	public int getTypeValue() {
		if (type != null && type.length() > 0) {
			if (type.equals(ExpenseFlag.PAYMENT.toString())) {
				return 1;
			}
			if (type.equals(ExpenseFlag.EXPENSE.toString())) {
				return 2;
			}
		}

		return 0;
	}

	@Override
	public String toString() {
		return new StringBuilder().append(paymentOrderNO).append("|")
				.append(getTypeValue()).append("|").append(amount).toString();
	}

}
